/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-12-17
 * Time: 15:33
 */
public class ArraySum {
    public static String arraySum(int[] array,int n) {
        int j = 0;
        while(j < array.length - 1) {
            for (int i = j+1; i < array.length; i++) {
                if(array[j] + array[i] == n) {
                    return "[" + j + "," + i +"]";
                }
            }
            j++;
        }
        return null;
    }
    public static void main(String[] args) {
        int[] array = new int[]{2,7,11,15};
        System.out.println(arraySum(array, 9));
    }
}
